<h1>Change Password:</h1>
<hr/>
<g:javascript>
    function doOk(t) {
        if (t == "") {
            alert("Changed password successfully.");
            $.colorbox.close();
        } else {
            $("#errorDiv").html(t);
            $("#errorDiv").show();
            $.colorbox.resize();
        }
    }
    function doFail(t,t1) {
        alert("Fail: " + t + ": " + t1);
    }

    $(document).ready(function(){
        $(".btn-text").button();
        $(".toolbar").buttonset();
        $(".hidden").hide();
        setTimeout('$("#old").focus();',1000);
    });


</g:javascript>
<div id="errorDiv" class="errors hidden">
</div>
<g:formRemote name="changePasswordForm" url="[controller: 'account', action: 'changePasswordSelf', id: id]" onSuccess="doOk(data)" onFailure="doFail(textStatus, errorThrown)">
    <table style="border: none;">
        <tr>
            <td>Old Password:</td>
            <td><input type="password" name="old" id="old" /></td>
        </tr>
        <tr>
            <td>New Password:</td>
            <td><input type="password" name="new1" id="new1"/></td>
        </tr>
        <tr>
            <td>Confirm Password:</td>
            <td><input type="password" name="new2" id="new2"/></td>
        </tr>
        <tr>
            <td colspan="2">
                <hr/>
                <br/>
                <div class="css_right toolbar">
                    <g:submitButton class="btn" name="submit" value="Change" />
                </div>
            </td>
        </tr>
    </table>
</g:formRemote>